home *** CD-ROM | disk | FTP | other *** search
/ Developer Source 4 / developer source - volume 4.iso / bytem / sep95 / 1p267.gif < prev    next >
Graphics Interchange Format  |  1995-11-21  |  7KB  |  512x332  |  4-bit (4 colors)
Labels: text | screenshot | font | number
OCR: Numeric Integration A J program for performing numeric integration using Simpson's method. NB. form: verb simpson int NB. verb is the monadic function to be integrated. NB. int has 2 or 3 elements: NB. [0] lower bound of interval NB. [1] upper bound of interval NB. [2] number of subintervals (default 128) NB. result is the integral NB. e.g. 43.75 = ^&3 simpson 3 4 simpson =: 2 : 0 ('lower '; 'upper'; 'int') =. 3{ .y . , 128 size =. (upper-lower)%int val =. x. lower+size*i.>:int size * +/val * 3%~ 1,((int-1)$4 2),1